﻿using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;

namespace Common
{
    public interface IUnit
    {
        int Hp { get; }
        int AllHp { get; }
        Vector3 Position { get; }
        float Friction { get; }
        Vector2 Excursion { get; }
        MovementType Direction { get; }
        int Id { get; }
        string Name { get; }
        Transform NameTagTransform { get; }
        Transform HeadTransform { get; }
        Collider Weapon { get; }
        Collider Collider { get; }
        void CrossAnimation(string animationName);
        bool Dead { get; }
        void OnBeat(ActionBase action, int hp, IUnit from, bool net);
        void DoAction(UInt16 actionId, bool net);
        event PositionChangeHandler OnPositionChange;
        event Action<IUnit, int> OnHpChange;
        /// <summary>
        /// deader, killer
        /// </summary>
        event Action<IUnit, IUnit> OnDead;
    }
    public delegate void PositionChangeHandler(IUnit sender, Vector3 pos);
}
